#if !defined(GAMEAPP_H)
#define GAMEAPP_H

#include "D3dApp.h"
#include "wrl/client.h"
#include "cube.h"

class GameApp :public D3dApp {
protected:
    template<class T>
    using ComPtr = Microsoft::WRL::ComPtr<T>;

    ComPtr<ID3D11VertexShader> pVertexShader;
    ComPtr<ID3D11PixelShader> pPixelShader;
    ComPtr<ID3D11InputLayout> pInputLayout;
    ComPtr<ID3D11Buffer> pVertexBuffer;
    ComPtr<ID3D11Buffer> pIndexBuffer;
    ComPtr<ID3D11Buffer> pConstantBuffer;

    ConstantBuffer cbuffer;

public:
    
    GameApp(HINSTANCE hInstance)
        :D3dApp(hInstance, L"DX11", 800, 450) {}
    ~GameApp() {}
    void UpdateScene(float dt)override;
    void DrawScene()override;
    bool InitEffect();
    bool InitResource();
    bool Init()override;
    static HRESULT CreateShaderFromFile(
        const std::wstring& input,
        const std::wstring& output,
        LPCSTR entry,
        LPCSTR shaderModel,
        ID3DBlob** ppBlobOut
    );
};
#endif // GAMEAPP_H